<?php require('../config/config.php');?>
<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>发布结果-<?php echo $web_title; ?></title>
    <link href="../style/css.css" rel="stylesheet">
  </head>
  <body>
    <div class="container">
	<div class="col-xs-0 col-sm-0 col-md-2 col-lg-2"></div>
	<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
	    <div class="panel text-center">
		<div class="panel-heading">
		    <h2>发布结果-<?php echo $web_title; ?></h2>
		</div>
		<div class="panel-body">
		    
		    <?php
		    error_reporting(0);
			if(file_exists('../install/ok.lock')){
			require('../config/connect.php');
			$a_title = $_POST['titles'];
			$a_content = $_POST['contents'];
			$a_lable = $_POST['lable'];
			$a_id = $_COOKIE['id'];
			if ($a_content == "" || $a_title == ""){
				echo '可以发布没有标签,但不可以没有文章标题和内容&nbsp;&nbsp;||'."<a class='text-main' href='index.php'>返回重新发布</a>";
			}else{
					$check = "/<script>/";
					if(preg_match($check,$a_content) || preg_match($check,$a_title)){
						echo "非法的内容,请不要使用&lt;script&gt;标签";
					}else{
					$a_sql = "INSERT INTO article(userid,title,content,lable,times) values ('$a_id','$a_title','$a_content','$a_lable',NOW())";
					$_mysqli -> query($a_sql);
					echo "发布成功啦!返回<a href='../' class='text-main'>首页</a>查看吧";}
			}
			} else {
			    echo '你还没有安装程序呢!';
			}
		    ?>
		    
		</div>
		<div class="panel-footer">
		    作者:xuthus
		</div>
	    </div>
	</div>
	<div class="col-xs-0 col-sm-0 col-md-2 col-lg-2"></div>
    </div>
  </body>
</html>

